<template>
  <div @click="onChooseDog">
    <img :src="dogSrc" alt="">
    <p>{{dogBreed}}</p>
  </div>
</template>

<script>
export default {
  data () {
    return {

    }
  },

  props: ['dogSrc', 'dogBreed', 'i'],

  created () {

  },

  computed: {

  },

  methods: {
    onChooseDog () {
      // console.log(this.i)
      // this.$emit('choose-dog', this.i)

      this.$emit('choose-dog', this.dogBreed)

      // const obj = {
      //   dogSrc: this.dogSrc,
      //   dogBreed: this.dogBreed
      // }
      // this.$emit('choose-dog', obj)
    }
  }
}
</script>

<style scoped lang='less'>
  div {
    text-align: center;
    border: 1px solid black;
  }
  img {
    width: 200px;
    // height: auto;
    // 强迫症·必须对齐
    height: 200px;
  }
</style>
